{// 引入标签库 }
<tagLib name="html" />
<include file="Public:header" />
<style type="text/css">
    td span label{float:left; padding:3px; margin:2px; background:#E6E6E6; cursor:pointer; display:inline-block; }
    td span label.active{background:#F60; color:#fff;}
    #container{height:200px; width: 200px; float:left;}  
    #container_front{width: 600px; height:500px; border: 1px solid #000; position: absolute; top: 10px; background-color: #fff; overflow: hidden;}
    #container_m{ width: 550px; height: 450px; margin: 0 auto;}
    #cancel_btn{display: block; width: 600px; height: 18px; line-height: 18px; text-align: right;}
</style>
<script type="text/javascript" src="__TMPL__Common/js/calendar/calendar.php?lang=zh-cn" ></script>
<load href='__TMPL__Common/js/calendar/calendar.css' />
<load href='__TMPL__Common/js/calendar/calendar.js' />
<script type="text/javascript" src="http://api.map.baidu.com/api?v=1.2"></script> 
<load href='__TMPL__Common/js/map.js' />
<load href='__TMPL__Common/js/location.js' />
<script type="text/javascript">
var blue_point = "__ROOT__/system/blue_point.png";
var red_point = "__ROOT__/system/red_point.png";
	$(document).ready(function(){
		 $("input[name='search_api']").bind("click",function(){  
		 	var api_address = $("input[name='api_address']").val();
			var city=$("select[name='city_id']").find("option:selected").attr("rel");
			if ($.trim(api_address) == '') {
				alert("{%INPUT_KEY_PLEASE}");
			}
			else 
			{
				search_api(api_address, city);
			}
        });
		draw_map('{$vo.xpoint}','{$vo.ypoint}');
		$("#container_front").hide();
        $("#cancel_btn").bind("click",function(){ $("#container_front").hide(); });
        $("input[name='chang_api']").bind("click",function(){ 
            editMap($("input[name='xpoint']").attr('value'),$("input[name='ypoint']").attr('value'));
        });
		
		
	});

</script>
<load href='__TMPL__Common/js/supplier.js' />
<div class="main">
<div class="main_title"> {%EDIT_LOCATION} <a href="{:u("SupplierLocation/index")}" class="back_list">{%BACK_LIST}</a></div>
<div class="blank5"></div>
<form name="edit" action="__APP__" method="post" enctype="multipart/form-data">
<table class="form" cellpadding=0 cellspacing=0>
	<tr>
		<td colspan=2 class="topTd"></td>
	</tr>
	<tr>
		<td class="item_title">{%NAME}:</td>
		<td class="item_input"><input type="text" class="textbox require" name="name" value="{$vo.name}" /></td>
	</tr>
	<tr>
		<td class="item_title">{%TAGS}:</td>
		<td class="item_input">
			<input type="text" class="textbox" name="tags"  style="width:50%"  value="{$vo.tags}" />
			<span class="tip_span">[{%ADV_TAGS_TIPS}]</span>
		</td>
	</tr>
	<!--
	<tr>
		<td class="item_title">首页图片:</td>
		<td class="item_input">
			<html:imgUpload name = 'index_img' id='index_img' value='$vo.index_img' />
		</td>
	</tr>-->
	<tr>
		<td class="item_title">{%SUPPLIER_PREVIEW}:</td>
		<td class="item_input"><html:imgUpload name = 'preview' id='preview' value='$vo.preview' /></td>
	</tr>	
	<tr>
		<td class="item_title">{%SUPPLIER_NAME}:</td>
		<td class="item_input">
			<span id="supplier_list">
			<select name="supplier_id">
				<option value="0">{%EMPTY_SELECT_SUPPLIER}</option>
				<if condition="$supplier_info">
					<option value="{$supplier_info.id}" selected="selected">{$supplier_info.name}</option>
				</if>
			</select>
			</span>
			<input type="text" class="textbox" name="supplier_key" /> 
			<input type="button" name="supplier_key_btn" class="button" value="{%SEARCH}" />
			<span class="tip_span">{%AUTO_CREATE}</span>
		</td>
	</tr>
	<tr style="display:none;">
		<td class="item_title">{%LOCATION_BRAND}:</td>
		<td class="item_input">
			<foreach name="brand_list" item="brand">
				<label>
					<input type="checkbox" name="brand_id[]" value="{$brand.id}" <if condition="$brand['checked']">checked="checked"</if> />
					{$brand.name}
				</label>
			</foreach>
		</td>
	</tr>
	<tr>
		<td class="item_title">{%DEAL_CITY}:</td>
		<td class="item_input">
		<select name="city_id">
			<foreach name="city_list" item="city_item">
				<option value="{$city_item.id}" rel="{$city_item.name}" <if condition="$vo['city_id'] eq $city_item['id']">selected="selected"</if> >{$city_item.title_show}</option>
			</foreach>
		</select>
		</td>
	</tr>
	<tr>
		<td class="item_title">{%AREA_LIST}:</td>
		<td class="item_input" id="area_list">
			
		</td>
	</tr>
	<tr id="purpose_list">
		<td class="item_title">目的:</td>
		<td class="item_input">
			
		</td>
	</tr>
	<tr id="big_cate_box">
		<td class="item_title">{%DEAL_CATE_TREE}:</td>
		<td class="item_input">
		
		</td>
	</tr>	
	<tr id="sub_cate_box">
		<td class="item_title">{%DEALCATETYPE_INDEX}:</td>
		<td class="item_input">
			
		</td>
	</tr>
	<tr id="tag_group_preset">
		<td class="item_title">商户标签设置</td>
		<td class="item_input">
			
		</td>
	</tr>
	<tr>
		<td class="item_title">{%IS_MAIN}:</td>
		<td class="item_input">
			<select name="is_main">
				<option value="1" <if condition="$vo[is_main] eq 1">selected="selected"</if> >{%YES}</option>
				<option value="0" <if condition="$vo[is_main] eq 0">selected="selected"</if> >{%NO}</option>				
			</select>
			<span class="tip_span">[{%IS_MAIN_TIP}]</span>
		</td>
	</tr>
	
	<tr>
		<td class="item_title">{%LOCATION_ADDRESS}:</td>
		<td class="item_input"><input class="textbox" name="address" style="width:50%" value="{$vo.address}" /></td>
	</tr>	
	<tr>
		<td class="item_title">{%LOCATION_ROUTE}:</td>
		<td class="item_input"><textarea class="textarea" name="route" >{$vo.route}</textarea></td>
	</tr>
	<tr>
		<td class="item_title">人均：</td>
		<td class="item_input">
			<select name="avg_price">
				<option value="0" <if condition="$vo['avg_price'] eq 0">selected="selected"</if>>{%AVG_PRICE_0}</option>
                <option value="1" <if condition="$vo['avg_price'] eq 1">selected="selected"</if>>{%AVG_PRICE_1}</option>
                <option value="2" <if condition="$vo['avg_price'] eq 2">selected="selected"</if>>{%AVG_PRICE_2}</option>
                <option value="3" <if condition="$vo['avg_price'] eq 3">selected="selected"</if>>{%AVG_PRICE_3}</option>
                <option value="4" <if condition="$vo['avg_price'] eq 4">selected="selected"</if>>{%AVG_PRICE_4}</option>
                <option value="5" <if condition="$vo['avg_price'] eq 5">selected="selected"</if>>{%AVG_PRICE_5}</option>
			</select>
		</td>
	</tr>
	<tr>
		<td class="item_title">{%LOCATION_TEL}:</td>
		<td class="item_input"><input type="text" class="textbox" name="tel" value="{$vo.tel}" /></td>
	</tr>
	<tr>
		<td class="item_title">{%LOCATION_CONTACT}:</td>
		<td class="item_input"><input type="text" class="textbox" name="contact" value="{$vo.contact}" /></td>
	</tr>
	<tr>
		<td class="item_title">{%LOCATION_OPENTIME}:</td>
		<td class="item_input"><input type="text" class="textbox" name="open_time" value="{$vo.open_time}"  /></td>
	</tr>
	<tr>
		<td class="item_title">停车:</td>
		<td class="item_input"><input type="text" class="textbox" name="stop" value="{$vo.stop}"  /></td>
	</tr>
	<tr>
		<td class="item_title">餐位情况:</td>
		<td class="item_input">
			大厅：<input type="text" class="textbox" name="hall" value="{$vo.hall}"  />个餐坐<br>
			包厢：<input type="text" class="textbox" name="box" value="{$vo.box}"  />个
		</td>
	</tr>
	<tr>
		<td class="item_title">其他:</td>
		<td class="item_input">
			<label>银行支付:<input type="checkbox" name="is_bank" <if condition="$vo['is_bank'] eq 1">checked="checked"</if> value="1"></label>
			<label>有无吸烟区:<input type="checkbox" name="no_smoking" <if condition="$vo['no_smoking'] eq 1">checked="checked"</if> value="1"></label>
			<label>外卖:<input type="checkbox" name="takeaway" <if condition="$vo['takeaway'] eq 1">checked="checked"</if> value="1"></label>
			<label>在线预订<input type="checkbox" name="one_line_order" value="1" <if condition="$vo['one_line_order'] eq 1">checked="checked"</if>></label>
		</td>
	</tr>
	<tr id="takeaway_box" <if condition="$vo['takeaway'] eq 0">style="display:none"</if>>
		<td class="item_title">外卖信息:</td>
		<td class="item_input">
			起送价格：<input type="text" class="textbox" name="takeaway_price" value="{$vo.takeaway_price}"  /><br>
			起送份数：<input type="text" class="textbox" name="takeaway_nums" value="{$vo.takeaway_nums}"  /><br>
			折扣信息:<input type="text" class="textbox" name="takeaway_zk" value="{$vo.takeaway_zk}"  /><br>
			促销信息:<input type="text" class="textbox" name="takeaway_cx" value="{$vo.takeaway_cx}"  /><br>
			加盟时间:<input type="text" class="textbox" id="takeaway_time" name="takeaway_time" value="{$vo.takeaway_time|to_date="Y-m-d"}" onfocus="this.blur(); return showCalendar('takeaway_time', '%Y-%m-%d', false, false, 'takeaway_time');"  /><br>
			商家电话:<input type="text" class="textbox" id="takeaway_tel" name="takeaway_tel" value="{$vo.takeaway_tel}"  /><span class="tip_span">[该电话为接收会员订餐短信通知时用,必须填写正确！]</span>
		</td>
	</tr>
	<tr>
		<td class="item_title">{%IS_RECOMMEND}:</td>
		<td class="item_input">
			<label><input type="checkbox" name="is_recommend" value="1" <if condition="$vo['is_recommend'] eq 1">checked="checked"</if>></label>
		</td>
	</tr>
	<tr class="rec_brief" <if condition="$vo['is_recommend'] neq 1">style="display:none"</if>>
		<td class="item_title">推荐内容:</td>
		<td class="item_input">
		 <html:editor id="rec_brief" name="rec_brief" type="textarea" content="{$vo.rec_brief}" style="width:300px;height:80px"  /><br>
		</td>
	</tr>
	<tr>
		<td class="item_title">{%LOCATION_ONLINE_INFO}:</td>
		<td class="item_input">
			 <html:editor id="online_info" name="online_info" type="textarea" content="{$vo.online_info}" style="width:300px;height:80px"  /><br>
			 <span class="tip_span">可以加b标签对文字加粗、变红。例：菜单<b>4</b>折优惠。其中“4”在前台显示为红色加粗</span>
		</td>
	</tr>
	<tr>
            <td class="item_title">地图定位</td>
            <td class="item_input">            	
            	关键词：<input type="text" class="textbox" name="api_address" value="" /> 
				<input type="button" value="查找" class="button" name="search_api" id="search_api" >
				<div style="height:10px; clear:both;"></div>
                <div id="container"></div>
				<div style="height:10px; clear:both;"></div>
                <script type="text/javascript"></script> 
                <input type="button" value="手动修改" name="chang_api" id="chang_api">
                <div style="position:relative; top:-400px;">
                    <div  id="container_front">
                        <a href="#" id="cancel_btn">取消</a>
                        <div id="container_m"></div>
                    </div>
                </div>
				<input type="hidden" name="xpoint" value="{$vo.xpoint}" />
				<input type="hidden" name="ypoint" value="{$vo.ypoint}" />
            </td>
    </tr>
	<tr>
		<td class="item_title">{%LOCATION_BRIEF}:</td>
		<td class="item_input">
		 <html:editor id="brief" name="brief" type="KINDEDITOR" content="{$vo.brief}" />
		</td>
	</tr>
	<tr>
		<td class="item_title">短信内容:</td>
		<td class="item_input">
		 <html:editor id="sms_content" name="sms_content" type="textarea" content="{$vo.sms_content}" style="width:300px;height:80px"  /><br>
		 <span class="tip_span">[若不填发送的短信内容为：名称+电话+地址]</span>
		</td>
	</tr>
	<tr>
		<td class="item_title">总评分预设值[0-5]:</td>
		<td class="item_input">
		 <input type="text" class="textbox" id="avg_point" name="avg_point" value="{$vo.avg_point}" />
		</td>
	</tr>
	<tr>
		<td class="item_title">好评预设值[0-1]:</td>
		<td class="item_input">
		 <input type="text" class="textbox" id="good_rate" name="good_rate" value="{$vo.good_rate}" />
		</td>
	</tr>
	<tr>
		<td class="item_title">SEO标题:</td>
		<td class="item_input"><textarea class="textarea" name="seo_title" >{$vo.seo_title}</textarea></td>
	</tr>
	<tr>
		<td class="item_title">SEO关键词:</td>
		<td class="item_input"><textarea class="textarea" name="seo_keyword" >{$vo.seo_keyword}</textarea></td>
	</tr>
	<tr>
		<td class="item_title">SEO描述:</td>
		<td class="item_input"><textarea class="textarea" name="seo_description" >{$vo.seo_description}</textarea></td>
	</tr>
	
	<tr>
		<td class="item_title">营业执照:</td>
		<td class="item_input">
			<html:imgUpload name = 'biz_license' id='biz_license' value='$vo.biz_license' />
		</td>
	</tr>
	
	<tr>
		<td class="item_title">其他资质:</td>
		<td class="item_input">
			<html:imgUpload name = 'biz_other_license' id='biz_other_license' value='$vo.biz_other_license' />
		</td>
	</tr>
	
	<tr>
		<td class="item_title"></td>
		<td class="item_input">
			<!--隐藏元素-->
			<input type="hidden" name="id" value="{$vo.id}" />
			<input type="hidden" name="{:conf("VAR_MODULE")}" value="SupplierLocation" />
			<input type="hidden" name="{:conf("VAR_ACTION")}" value="update" />
			<!--隐藏元素-->
			<input type="submit" class="button" value="{%EDIT}" />
			<input type="reset" class="button" value="{%RESET}" />
		</td>
	</tr>
	<tr>
		<td colspan=2 class="bottomTd"></td>
	</tr>
</table>	 
</form>
</div>
<include file="Public:footer" />